package com.qf.day02;

/**
 * 演示while循环的用法
 */
public class WhileDemo {
    public static void main(String[] args) {

//        int count = 1; // 循环的次数
//        //打印100遍我喜欢MySQL
//        while (count<=100){
//            System.out.println("我喜欢mysql:"+count);
//            count++;
//        }

        // 2、求得一个数是几位数?
        int number = 110;
        int copyNUmber = number;
        int count = 0;

        if (number==0){
            System.out.println("0是1位数");
        }else {
            while (number > 0) {
                number = number / 10;
                count++;
            }
            System.out.println(copyNUmber + "为：" + count + "位数");
        }


    }
}
